<!DOCTYPE html>
<html>
<head>
	<?php
	include "connection-provider.php";
	session_start();
		$_SESSION['adminQuestionType'];
		$typeId = $_SESSION['adminQuestionType'];
		echo $typeId;
		
?>
</head>
<body>
<?php
	
	function validateQuestion($questionTable, $questionTextArea, $optionOnefunc, $optionTwofunc, $optionThreefunc, $optionFourfunc, $optionRadio, $questionNumber)
	{
	
			session_start();
		$_SESSION['adminQuestionType'];
		$typeId = $_SESSION['adminQuestionType'];
		echo $typeId;
		$questionID = $questionNumber;
	//$questionTable = "question_table";

			$question = addslashes(mysql_real_escape_string($questionTextArea));			
			$optionOne = addslashes(mysql_real_escape_string($optionOnefunc));
			$optionTwo = addslashes(mysql_real_escape_string($optionTwofunc));
			$optionThree = addslashes(mysql_real_escape_string($optionThreefunc));
			$optionFour = addslashes(mysql_real_escape_string($optionFourfunc));

			if(empty($question))
			{
				$url="add-question.php?isEmpty=yes&one=$optionOne&two=$optionTwo&three=$optionThree&four=$optionFour&selectType=$typeId&hiddenQuestionId=$questionID";			
				header("Refresh:0;URL=$url");
				exit(0);
			}
			elseif(empty($optionOne))
			{
				$url="add-question.php?isEmpty=yes&question=$question&two=$optionTwo&three=$optionThree&four=$optionFour&selectType=$typeId&hiddenQuestionId=$questionID";					
				header("Refresh:0;URL=$url");
				exit(0);
			}
			elseif(empty($optionTwo))
			{
				$url="add-question.php?isEmpty=yes&question=$question&one=$optionOne&three=$optionThree&four=$optionFour&selectType=$typeId&hiddenQuestionId=$questionID";					
				header("Refresh:0;URL=$url");
				exit(0);
			}
			elseif(empty($optionThree))
			{
				$url="add-question.php?isEmpty=yes&question=$question&two=$optionTwo&one=$optionOne&four=$optionFour&selectType=$typeId&hiddenQuestionId=$questionID";					
				header("Refresh:0;URL=$url");
				exit(0);
			}
			elseif(empty($optionOne))
			{
				$url="add-question.php?isEmpty=yes&question=$question&two=$optionTwo&three=$optionThree&one=$optionOne&selectType=$typeId&hiddenQuestionId=$questionID";					
				header("Refresh:0;URL=$url");
				exit(0);
			}
			elseif(empty($optionRadio))
			{
				$url="add-question.php?isEmpty=yes&isEmptyCheck=yes&question=$question&one=$optionOne&two=$optionTwo&three=$optionThree&four=$optionFour&selectType=$typeId&hiddenQuestionId=$questionID";
				header("Refresh:0;URL=$url");
				exit(0);
			}
						
	}
	
?>

</body>
</html>